{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Sample_of_training_process_with_google_colab.ipynb",
      "provenance": [],
      "collapsed_sections": [],
      "authorship_tag": "ABX9TyNuDmMvMBzbNGdxTXJXtAYo",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/s-mostafa-a/Luna16/blob/master/notebooks/Sample_of_training_process_with_google_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "UNakblVzwAir",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 153
        },
        "outputId": "4ad9d12e-c567-4a59-a753-d20afcee7cb2"
      },
      "source": [
        "!git clone http://github.com/s-mostafa-a/Luna16"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Cloning into 'Luna16'...\n",
            "warning: redirecting to https://github.com/s-mostafa-a/Luna16/\n",
            "remote: Enumerating objects: 166, done.\u001b[K\n",
            "remote: Counting objects:   0% (1/166)\u001b[K\rremote: Counting objects:   1% (2/166)\u001b[K\rremote: Counting objects:   2% (4/166)\u001b[K\rremote: Counting objects:   3% (5/166)\u001b[K\rremote: Counting objects:   4% (7/166)\u001b[K\rremote: Counting objects:   5% (9/166)\u001b[K\rremote: Counting objects:   6% (10/166)\u001b[K\rremote: Counting objects:   7% (12/166)\u001b[K\rremote: Counting objects:   8% (14/166)\u001b[K\rremote: Counting objects:   9% (15/166)\u001b[K\rremote: Counting objects:  10% (17/166)\u001b[K\rremote: Counting objects:  11% (19/166)\u001b[K\rremote: Counting objects:  12% (20/166)\u001b[K\rremote: Counting objects:  13% (22/166)\u001b[K\rremote: Counting objects:  14% (24/166)\u001b[K\rremote: Counting objects:  15% (25/166)\u001b[K\rremote: Counting objects:  16% (27/166)\u001b[K\rremote: Counting objects:  17% (29/166)\u001b[K\rremote: Counting objects:  18% (30/166)\u001b[K\rremote: Counting objects:  19% (32/166)\u001b[K\rremote: Counting objects:  20% (34/166)\u001b[K\rremote: Counting objects:  21% (35/166)\u001b[K\rremote: Counting objects:  22% (37/166)\u001b[K\rremote: Counting objects:  23% (39/166)\u001b[K\rremote: Counting objects:  24% (40/166)\u001b[K\rremote: Counting objects:  25% (42/166)\u001b[K\rremote: Counting objects:  26% (44/166)\u001b[K\rremote: Counting objects:  27% (45/166)\u001b[K\rremote: Counting objects:  28% (47/166)\u001b[K\rremote: Counting objects:  29% (49/166)\u001b[K\rremote: Counting objects:  30% (50/166)\u001b[K\rremote: Counting objects:  31% (52/166)\u001b[K\rremote: Counting objects:  32% (54/166)\u001b[K\rremote: Counting objects:  33% (55/166)\u001b[K\rremote: Counting objects:  34% (57/166)\u001b[K\rremote: Counting objects:  35% (59/166)\u001b[K\rremote: Counting objects:  36% (60/166)\u001b[K\rremote: Counting objects:  37% (62/166)\u001b[K\rremote: Counting objects:  38% (64/166)\u001b[K\rremote: Counting objects:  39% (65/166)\u001b[K\rremote: Counting objects:  40% (67/166)\u001b[K\rremote: Counting objects:  41% (69/166)\u001b[K\rremote: Counting objects:  42% (70/166)\u001b[K\rremote: Counting objects:  43% (72/166)\u001b[K\rremote: Counting objects:  44% (74/166)\u001b[K\rremote: Counting objects:  45% (75/166)\u001b[K\rremote: Counting objects:  46% (77/166)\u001b[K\rremote: Counting objects:  47% (79/166)\u001b[K\rremote: Counting objects:  48% (80/166)\u001b[K\rremote: Counting objects:  49% (82/166)\u001b[K\rremote: Counting objects:  50% (83/166)\u001b[K\rremote: Counting objects:  51% (85/166)\u001b[K\rremote: Counting objects:  52% (87/166)\u001b[K\rremote: Counting objects:  53% (88/166)\u001b[K\rremote: Counting objects:  54% (90/166)\u001b[K\rremote: Counting objects:  55% (92/166)\u001b[K\rremote: Counting objects:  56% (93/166)\u001b[K\rremote: Counting objects:  57% (95/166)\u001b[K\rremote: Counting objects:  58% (97/166)\u001b[K\rremote: Counting objects:  59% (98/166)\u001b[K\rremote: Counting objects:  60% (100/166)\u001b[K\rremote: Counting objects:  61% (102/166)\u001b[K\rremote: Counting objects:  62% (103/166)\u001b[K\rremote: Counting objects:  63% (105/166)\u001b[K\rremote: Counting objects:  64% (107/166)\u001b[K\rremote: Counting objects:  65% (108/166)\u001b[K\rremote: Counting objects:  66% (110/166)\u001b[K\rremote: Counting objects:  67% (112/166)\u001b[K\rremote: Counting objects:  68% (113/166)\u001b[K\rremote: Counting objects:  69% (115/166)\u001b[K\rremote: Counting objects:  70% (117/166)\u001b[K\rremote: Counting objects:  71% (118/166)\u001b[K\rremote: Counting objects:  72% (120/166)\u001b[K\rremote: Counting objects:  73% (122/166)\u001b[K\rremote: Counting objects:  74% (123/166)\u001b[K\rremote: Counting objects:  75% (125/166)\u001b[K\rremote: Counting objects:  76% (127/166)\u001b[K\rremote: Counting objects:  77% (128/166)\u001b[K\rremote: Counting objects:  78% (130/166)\u001b[K\rremote: Counting objects:  79% (132/166)\u001b[K\rremote: Counting objects:  80% (133/166)\u001b[K\rremote: Counting objects:  81% (135/166)\u001b[K\rremote: Counting objects:  82% (137/166)\u001b[K\rremote: Counting objects:  83% (138/166)\u001b[K\rremote: Counting objects:  84% (140/166)\u001b[K\rremote: Counting objects:  85% (142/166)\u001b[K\rremote: Counting objects:  86% (143/166)\u001b[K\rremote: Counting objects:  87% (145/166)\u001b[K\rremote: Counting objects:  88% (147/166)\u001b[K\rremote: Counting objects:  89% (148/166)\u001b[K\rremote: Counting objects:  90% (150/166)\u001b[K\rremote: Counting objects:  91% (152/166)\u001b[K\rremote: Counting objects:  92% (153/166)\u001b[K\rremote: Counting objects:  93% (155/166)\u001b[K\rremote: Counting objects:  94% (157/166)\u001b[K\rremote: Counting objects:  95% (158/166)\u001b[K\rremote: Counting objects:  96% (160/166)\u001b[K\rremote: Counting objects:  97% (162/166)\u001b[K\rremote: Counting objects:  98% (163/166)\u001b[K\rremote: Counting objects:  99% (165/166)\u001b[K\rremote: Counting objects: 100% (166/166)\u001b[K\rremote: Counting objects: 100% (166/166), done.\u001b[K\n",
            "remote: Compressing objects: 100% (118/118), done.\u001b[K\n",
            "remote: Total 504 (delta 84), reused 113 (delta 44), pack-reused 338\u001b[K\n",
            "Receiving objects: 100% (504/504), 3.30 MiB | 2.98 MiB/s, done.\n",
            "Resolving deltas: 100% (251/251), done.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zlLo_R1kwLHs",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 122
        },
        "outputId": "6440cb84-8580-411a-974d-97c96210b0f1"
      },
      "source": [
        "from google.colab import drive\n",
        "drive.mount(\"/content/drive\")"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly&response_type=code\n",
            "\n",
            "Enter your authorization code:\n",
            "··········\n",
            "Mounted at /content/drive\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "fLSvMwBcwZ3d",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!cp ./drive/My\\ Drive/input.zip ./"
      ],
      "execution_count": 3,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "mHmVOGqHwnaZ",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 394
        },
        "outputId": "ce9e8678-3414-4dce-9e5b-ffb7bf207c6d"
      },
      "source": [
        "!unzip input.zip"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Archive:  input.zip\n",
            "   creating: input/\n",
            "   creating: input/subset/\n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.109002525524522225658609808059.raw  \n",
            "   creating: __MACOSX/\n",
            "   creating: __MACOSX/input/\n",
            "   creating: __MACOSX/input/subset/\n",
            "  inflating: __MACOSX/input/subset/._1.3.6.1.4.1.14519.5.2.1.6279.6001.109002525524522225658609808059.raw  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.238522526736091851696274044574.mhd  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.272042302501586336192628818865.raw  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.311981398931043315779172047718.mhd  \n",
            "  inflating: input/subset/.DS_Store  \n",
            "  inflating: __MACOSX/input/subset/._.DS_Store  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.311981398931043315779172047718.raw  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.272042302501586336192628818865.mhd  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.238522526736091851696274044574.raw  \n",
            "  inflating: input/subset/1.3.6.1.4.1.14519.5.2.1.6279.6001.109002525524522225658609808059.mhd  \n",
            "  inflating: input/.DS_Store         \n",
            "  inflating: __MACOSX/input/._.DS_Store  \n",
            "  inflating: input/candidates.csv    \n",
            "  inflating: input/annotations.csv   \n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "r4TyVxlJw1S4",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!rm -r __MACOSX"
      ],
      "execution_count": 5,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "S-YELs8ZxBhV",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!mkdir output"
      ],
      "execution_count": 6,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "5p_gkGcHXBwX",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "f = open(\"./Luna16/setup.py\", \"w+\")\n",
        "f.write(\"\"\"\n",
        "from setuptools import setup, find_packages\n",
        "setup(name='mosiluna', version='1.0', packages=find_packages())\n",
        "\"\"\")\n",
        "f.close()"
      ],
      "execution_count": 7,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QGZ5d_QZWFSW",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "b23b4c3f-cc51-4567-a916-6554d03f3853"
      },
      "source": [
        "%cd Luna16/"
      ],
      "execution_count": 8,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/content/Luna16\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "htdUiWDDWWCL",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 85
        },
        "outputId": "15c38f20-be63-4ebc-b31d-f36df285969e"
      },
      "source": [
        "!pip install -e ."
      ],
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Obtaining file:///content/Luna16\n",
            "Installing collected packages: mosiluna\n",
            "  Running setup.py develop for mosiluna\n",
            "Successfully installed mosiluna\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tDL6f5tzWt9q",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "8d1d0448-c528-419f-8397-5c4325e07722"
      },
      "source": [
        "%cd .."
      ],
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/content\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "GaUYU8Nbx4Z_",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 54
        },
        "outputId": "833a74de-83e4-4842-8aa5-3a071ba2b7a1"
      },
      "source": [
        "import os\n",
        "import sys\n",
        "ls = ['Luna16']\n",
        "for f in ls:\n",
        "  fp = os.path.abspath(os.path.join(f))\n",
        "  if fp not in sys.path:\n",
        "    sys.path.insert(1, fp)\n",
        "print(sys.path)"
      ],
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "['', '/content/Luna16', '/env/python', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/local/lib/python3.6/dist-packages/IPython/extensions', '/root/.ipython']\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QriL8yzHXg7k",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 122
        },
        "outputId": "9051cdfb-07dc-4edf-d00a-ddb663ab4c82"
      },
      "source": [
        "!pip install SimpleITK"
      ],
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting SimpleITK\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/f8/d8/53338c34f71020725ffb3557846c80af96c29c03bc883551a2565aa68a7c/SimpleITK-1.2.4-cp36-cp36m-manylinux1_x86_64.whl (42.5MB)\n",
            "\u001b[K     |████████████████████████████████| 42.5MB 72kB/s \n",
            "\u001b[?25hInstalling collected packages: SimpleITK\n",
            "Successfully installed SimpleITK-1.2.4\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "chenWodWadm8",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "f = open(\"./Luna16/configs.py\", \"w+\")\n",
        "f.write(\"\"\"\n",
        "OUTPUT_PATH = '/content/output'\n",
        "RESOURCES_PATH = '/content/input'\n",
        "\n",
        "\n",
        "PADDING_FOR_LOCALIZATION = 10\n",
        "BLOCK_SIZE = 128\n",
        "COORDS_CUBE_SIZE = 32\n",
        "TARGET_SHAPE = (32, 32, 32, 3, 5)\n",
        "COORDS_SHAPE = (3, 32, 32, 32)\n",
        "ANCHOR_SIZES = [10, 30, 60]\n",
        "VAL_PCT = 0.5\n",
        "TOTAL_EPOCHS = 15\n",
        "DEFAULT_LR = 0.01\"\"\")\n",
        "f.close()"
      ],
      "execution_count": 13,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LekqzfjzSv_Y",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!python ./Luna16/prepare/run_preprocess.py"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZZivro3dxSe4",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!python ./Luna16/prepare/run_augmentation.py"
      ],
      "execution_count": 15,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "3ogr5ZlDBWc4",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "dfd8ef90-19da-4562-de93-ddf2d96c3e15"
      },
      "source": [
        "!python ./Luna16/main/train.py"
      ],
      "execution_count": 16,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Training from epoch: 0 towards: 15,\n",
            "with learning rate starting from: 0.01, and loss: None\n",
            "Epoch 0 (lr 0.01)\n",
            "./Luna16/main/train.py:72: RuntimeWarning: invalid value encountered in double_scalars\n",
            "  time {end_time - start_time}''')\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.996196746826172\n",
            "loss 0.06769299507141113, classify loss 0.06769299507141113,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8379347324371338\n",
            "loss 6.092975616455078, classify loss 0.66817307472229,\n",
            "            regress loss 0.2844771146774292, 0.2832562327384949, \n",
            "            0.17639203369617462, 4.68067741394043\n",
            "Epoch 1 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5329277515411377\n",
            "loss 0.005796412006020546, classify loss 0.005796412006020546,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8477580547332764\n",
            "loss 6.109285354614258, classify loss 0.669579267501831,\n",
            "            regress loss 0.2968667149543762, 0.2918669581413269, \n",
            "            0.17043304443359375, 4.680539608001709\n",
            "Epoch 2 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.533916711807251\n",
            "loss 0.006312052719295025, classify loss 0.006312052719295025,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8415253162384033\n",
            "loss 6.126202583312988, classify loss 0.6751894354820251,\n",
            "            regress loss 0.3035137951374054, 0.29715394973754883, \n",
            "            0.17484533786773682, 4.67549991607666\n",
            "Epoch 3 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.511228322982788\n",
            "loss 0.0027763021644204855, classify loss 0.0027763021644204855,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.84541916847229\n",
            "loss 6.12541389465332, classify loss 0.6794085502624512,\n",
            "            regress loss 0.3051617741584778, 0.29836714267730713, \n",
            "            0.17585179209709167, 4.666625022888184\n",
            "Epoch 4 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5250134468078613\n",
            "loss 0.00016933577717281878, classify loss 0.00016933577717281878,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8395485877990723\n",
            "loss 6.115325450897217, classify loss 0.6843740940093994,\n",
            "            regress loss 0.2993559241294861, 0.29877543449401855, \n",
            "            0.17899292707443237, 4.65382719039917\n",
            "Epoch 5 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5404298305511475\n",
            "loss 0.00033080874709412456, classify loss 0.00033080874709412456,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8384096622467041\n",
            "loss 6.1117377281188965, classify loss 0.6898453235626221,\n",
            "            regress loss 0.29192349314689636, 0.3015168309211731, \n",
            "            0.18161340057849884, 4.646838665008545\n",
            "Epoch 6 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5234179496765137\n",
            "loss 0.0006552994018420577, classify loss 0.0006552994018420577,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8411819934844971\n",
            "loss 6.105742454528809, classify loss 0.6942460536956787,\n",
            "            regress loss 0.28211691975593567, 0.30432942509651184, \n",
            "            0.1827109158039093, 4.64233922958374\n",
            "Epoch 7 (lr 0.01)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.531121015548706\n",
            "loss 0.0006890749791637063, classify loss 0.0006890749791637063,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8395299911499023\n",
            "loss 6.099771976470947, classify loss 0.697428822517395,\n",
            "            regress loss 0.27392318844795227, 0.306479275226593, \n",
            "            0.1837279200553894, 4.638213157653809\n",
            "Epoch 8 (lr 0.001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5326223373413086\n",
            "loss 8.642748070997186e-06, classify loss 8.642748070997186e-06,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8477745056152344\n",
            "loss 6.110715389251709, classify loss 0.7040237188339233,\n",
            "            regress loss 0.2693430781364441, 0.30880188941955566, \n",
            "            0.18182224035263062, 4.646724700927734\n",
            "Epoch 9 (lr 0.001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5089550018310547\n",
            "loss 1.1920930376163597e-07, classify loss 1.1920930376163597e-07,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8399713039398193\n",
            "loss 6.12252140045166, classify loss 0.7105377912521362,\n",
            "            regress loss 0.26551786065101624, 0.3123427629470825, \n",
            "            0.1822914183139801, 4.65183162689209\n",
            "Epoch 10 (lr 0.001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.6330275535583496\n",
            "loss 2.9504387839551782e-06, classify loss 2.9504387839551782e-06,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8405866622924805\n",
            "loss 6.127664566040039, classify loss 0.7167516350746155,\n",
            "            regress loss 0.26125669479370117, 0.315950870513916, \n",
            "            0.18292918801307678, 4.650776386260986\n",
            "Epoch 11 (lr 0.001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5427770614624023\n",
            "loss 6.854538696643431e-07, classify loss 6.854538696643431e-07,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8434076309204102\n",
            "loss 6.127445220947266, classify loss 0.7217230796813965,\n",
            "            regress loss 0.25685176253318787, 0.31876933574676514, \n",
            "            0.18285752832889557, 4.647243499755859\n",
            "Epoch 12 (lr 0.001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.5186853408813477\n",
            "loss 3.978770837420598e-05, classify loss 3.978770837420598e-05,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8432469367980957\n",
            "loss 6.129652976989746, classify loss 0.7262092232704163,\n",
            "            regress loss 0.25293755531311035, 0.32112622261047363, \n",
            "            0.18299956619739532, 4.646380424499512\n",
            "Epoch 13 (lr 0.0001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.503950834274292\n",
            "loss 1.0132800980500178e-06, classify loss 1.0132800980500178e-06,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8391354084014893\n",
            "loss 6.131683349609375, classify loss 0.730771005153656,\n",
            "            regress loss 0.24951830506324768, 0.3214690089225769, \n",
            "            0.18399593234062195, 4.645929336547852\n",
            "Epoch 14 (lr 0.0001)\n",
            "Train: tpr nan,\n",
            "            tnr 0.0, \n",
            "            total pos 0.0, total neg 2.0, \n",
            "            time 3.520341396331787\n",
            "loss 5.960465188081798e-08, classify loss 5.960465188081798e-08,\n",
            "            regress loss 0.0, 0.0, \n",
            "            0.0, 0.0\n",
            "time 0.8440964221954346\n",
            "loss 6.1372270584106445, classify loss 0.735541582107544,\n",
            "            regress loss 0.24856770038604736, 0.3205026686191559, \n",
            "            0.18569210171699524, 4.646923065185547\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "JFpJJXkvcrgL",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}